package com.ljf.framework.context;


import com.ljf.framework.LjfManager;
import com.ljf.framework.context.model.LjfRequest;
import com.ljf.framework.context.model.LjfResponse;
import com.ljf.framework.context.model.LjfStorage;

public class LjfContextManager {

	/**
	 * 获取当前请求的 Context
	 *
	 * @return see note
	 */
	public static LjfContext getContext() {
		return LjfManager.getLjfContextOrSecond();
	}

	/**
	 * 获取当前请求的 [Request] 对象
	 *
	 * @return see note
	 */
	public static LjfRequest getRequest() {
		return LjfManager.getLjfContextOrSecond().getRequest();
	}

	/**
	 * 获取当前请求的 [Response] 对象
	 *
	 * @return see note
	 */
	public static LjfResponse getResponse() {
		return LjfManager.getLjfContextOrSecond().getResponse();
	}

	/**
	 * 获取当前请求的 [存储器] 对象
	 *
	 * @return see note
	 */
	public static LjfStorage getStorage() {
		return LjfManager.getLjfContextOrSecond().getStorage();
	}

	/**
	 * 设置当前请求的 [Request] 对象
	 *
	 * @param ljfRequest
	 */
	public static void setRequest(Object ljfRequest) {
		 LjfManager.getLjfContext().getRequest().setSource(ljfRequest);
	}
}
